package com.edu.bhu.admin.service.impl;

import java.util.List;

import com.edu.bhu.admin.domain.BikBicycle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.edu.bhu.admin.mapper.BikImagesMapper;
import com.edu.bhu.admin.domain.BikImages;
import com.edu.bhu.admin.service.IBikImagesService;
import com.edu.bhu.common.core.text.Convert;

/**
 * 图片Service业务层处理
 * 
 * @author heyinan
 * @date 2022-03-14
 */
@Service
public class BikImagesServiceImpl implements IBikImagesService 
{
    @Autowired
    private BikImagesMapper bikImagesMapper;

    /**
     * 查询图片
     * 
     * @param imagesId 图片主键
     * @return 图片
     */
    @Override
    public BikImages selectBikImagesByImagesId(Long imagesId)
    {
        return bikImagesMapper.selectBikImagesByImagesId(imagesId);
    }

    /**
     * 查询图片列表(根据单车ID)
     *
     * @param bikId 单车ID
     * @return 图片集合
     */
    public List<BikImages> selectBikImagesListByBikId(Long bikId)
    {
        return bikImagesMapper.selectBikImagesListByBikId(bikId);
    }

    /**
     * 查询图片列表
     * 
     * @param bikImages 图片
     * @return 图片
     */
    @Override
    public List<BikImages> selectBikImagesList(BikImages bikImages)
    {
        return bikImagesMapper.selectBikImagesList(bikImages);
    }

    /**
     * 新增图片
     * 
     * @param bikImages 图片
     * @return 结果
     */
    @Override
    public int insertBikImages(BikImages bikImages)
    {
        return bikImagesMapper.insertBikImages(bikImages);
    }

    /**
     * 修改图片
     * 
     * @param bikImages 图片
     * @return 结果
     */
    @Override
    public int updateBikImages(BikImages bikImages)
    {
        return bikImagesMapper.updateBikImages(bikImages);
    }

    /**
     * 批量删除图片
     * 
     * @param imagesIds 需要删除的图片主键
     * @return 结果
     */
    @Override
    public int deleteBikImagesByImagesIds(String imagesIds)
    {
        return bikImagesMapper.deleteBikImagesByImagesIds(Convert.toStrArray(imagesIds));
    }

    /**
     * 删除图片信息
     * 
     * @param imagesId 图片主键
     * @return 结果
     */
    @Override
    public int deleteBikImagesByImagesId(Long imagesId)
    {
        return bikImagesMapper.deleteBikImagesByImagesId(imagesId);
    }
}
